//
// Created by Administrator on 2025/7/3.
//

#ifndef SUB_SUB_H
#define SUB_SUB_H



#include <DDS/DomainParticipant.h>
#include "UserDataTypeListener.h"
#include <QObject>
class Q_DECL_EXPORT sub {
public:
    explicit sub(const int &id);
    ~sub();
    void read_message(std::string &message,std::string &md5);
private:
    DomainParticipant *participant = NULL;
    Subscriber *subscriber = NULL;
    Topic *topic = NULL;
    UserDataTypeListener *reader_listener = NULL;
    DataReader *reader = NULL;
    ReturnCode_t retcode;
    const char *type_name = NULL;
private:
    static int subscriber_shutdown(DomainParticipant *participant);
};


#endif //SUB_SUB_H
